
package cn2;

import java.util.*;

public class IsAliveTask extends TimerTask {

    private Overlay myOverlay;

    public IsAliveTask(Overlay o) {
        this.myOverlay = o;
    }

    public void setOverlay(Overlay o) {
       this.myOverlay = o;
    }

    public void run() {

        System.out.println("[IsAliveTask] pinging neighbours...");

        try {
            myOverlay.pingNeighbours();
            System.out.println("[IsAliveTask] finished...");

        } catch (Exception e) {
            System.out.println("[IsAliveTask] exception in run(): " + e.toString());
        }        
    }
}
